In [ ]:
###visualizaci{on del embedding space del VAE
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import  PCA
from mpl_toolkits.mplot3d import Axes3D
import librosa.display
import pickle
In [ ]:
fx = ["Clean", "TubeScreamer", "BluesDriver", "RAT", "Chorus", "Phaser", "Flanger", "Tape Echo","Sweep Echo", "Digital Delay", "Hall Reverb", "PlateReverb", "Spring Reverb"]
In [ ]:
####Visualización de los datos previo al VAE
with open('''waveforms.pkl''', 'rb') as f:
  waveforms = pickle.load(f)
In [ ]:
####visualización de los audios antes de normalizar
plt.figure(figsize=(15, 6))
sonidos = [i * 690 for i in range(13)]
for i, x in enumerate(sonidos):
    plt.subplot(3, 5, i+ 1).set_title(fx[i])
    librosa.display.waveshow(waveforms[x])
plt.tight_layout()
#plt.title("Waveforms")
plt.show()
In [ ]:
#######PCA dominio de la frecuencia ####
fft_pca = []
for i in waveforms:
  x_fft = np.fft.fft(i)
  x_fft = librosa.amplitude_to_db(np.abs(i))
  fft_pca.append(x_fft)

fft_pca = np.array(fft_pca)

mu_fft = np.mean(fft_pca, axis = 0)
Xmu_fft = fft_pca - mu_fft
s_fft = np.std(fft_pca, axis = 0)
Xmu_FFT = Xmu_fft/s_fft
In [ ]:
###visualización PCA
fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT)
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='gray', label= fx[0])
ax.scatter3D(X_PCA[690:1379, 0], X_PCA[690:1379, 1],X_PCA[690:1379, 2], c='green', label= fx[1])
ax.scatter3D(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1],X_PCA[1380:2069, 2], c='blue', label= fx[2])
ax.scatter3D(X_PCA[2070:2759, 0], X_PCA[2070:2759, 1],X_PCA[2070:2759, 2], c='red', label= fx[3])
ax.scatter3D(X_PCA[2760:3449, 0], X_PCA[2760:3449, 1],X_PCA[2760:3449, 2], c='yellow', label= fx[4])
ax.scatter3D(X_PCA[3450:4139, 0], X_PCA[3450:4139, 1],X_PCA[3450:4139, 2], c='black', label= fx[5])
ax.scatter3D(X_PCA[4140:4829, 0], X_PCA[4140:4829, 1],X_PCA[4140:4829, 2], c='magenta', label= fx[6])
ax.scatter3D(X_PCA[4830:5519, 0], X_PCA[4830:5519, 1],X_PCA[4830:5519, 2], c='orange', label= fx[7])
ax.scatter3D(X_PCA[5520:6209, 0], X_PCA[5520:6209, 1],X_PCA[5520:6209, 2], c='pink', label= fx[8])
ax.scatter3D(X_PCA[6210:6899, 0], X_PCA[6210:6899, 1],X_PCA[6210:6899, 2], c='brown', label= fx[9])
ax.scatter3D(X_PCA[6900:7589, 0], X_PCA[6900:7589, 1],X_PCA[6900:7589, 2], c='cyan', label= fx[10])
ax.scatter3D(X_PCA[7590:8279, 0], X_PCA[7590:8279, 1],X_PCA[7590:8279, 2], c='lightgreen', label= fx[11])
ax.scatter3D(X_PCA[8280:, 0], X_PCA[8280:, 1],X_PCA[8280:, 2], c='indigo', label= fx[12])
fig.add_axes(ax)

plt.legend()
plt.title('Frequency Domain PCA 3D')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\2634854044.py:3: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.4851442  0.02558834 0.00787431]
In [ ]:
fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT)
print('variance: ')
print(pca.explained_variance_ratio_)

# "transform" the data that you want to reduce to "two components"
plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='gray', label= fx[0])
plt.scatter(X_PCA[690:1379, 0], X_PCA[690:1379, 1], c='green', label= fx[1])
plt.scatter(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1], c='blue', label= fx[2])
plt.scatter(X_PCA[2070:2759, 0], X_PCA[2070:2759, 1], c='red', label= fx[3])
plt.scatter(X_PCA[2760:3449, 0], X_PCA[2760:3449, 1], c='yellow', label= fx[4])
plt.scatter(X_PCA[3450:4139, 0], X_PCA[3450:4139, 1], c='black', label= fx[5])
plt.scatter(X_PCA[4140:4829, 0], X_PCA[4140:4829, 1], c='magenta', label= fx[6])
plt.scatter(X_PCA[4830:5519, 0], X_PCA[4830:5519, 1], c='orange', label= fx[7])
plt.scatter(X_PCA[5520:6209, 0], X_PCA[5520:6209, 1], c='pink', label= fx[8])
plt.scatter(X_PCA[6210:6899, 0], X_PCA[6210:6899, 1], c='brown', label= fx[9])
plt.scatter(X_PCA[6900:7589, 0], X_PCA[6900:7589, 1], c='cyan', label= fx[10])
plt.scatter(X_PCA[7590:8279, 0], X_PCA[7590:8279, 1], c='lightgreen', label= fx[11])
plt.scatter(X_PCA[8280:, 0], X_PCA[8280:, 1], c='indigo', label= fx[12])

plt.legend()
plt.title('PCA Frequency Domain 2D')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
variance: 
[0.4851443  0.02558834]
In [ ]:
###visualización PCA
fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT)
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='red', label= fx[0])
ax.scatter3D(X_PCA[690:2759, 0], X_PCA[690:2759, 1],X_PCA[690:2759, 2], c='green', label= 'Distortion')
ax.scatter3D(X_PCA[2760:4829, 0], X_PCA[2760:4829, 1],X_PCA[2760:4829, 2], c='yellow', label= 'Modulation')
ax.scatter3D(X_PCA[4830:6899, 0], X_PCA[4830:6899, 1],X_PCA[4830:6899, 2], c='orange', label= 'Delays')
ax.scatter3D(X_PCA[6900:8969, 0], X_PCA[6900:8969, 1],X_PCA[6900:8969, 2], c='cyan', label= 'Reverbs')

plt.legend()
plt.title('Frequency Domain PCA by Fx type')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\3387116110.py:3: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.4851443  0.02558834 0.00787432]
In [ ]:
fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT)
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='red', label= fx[0])
plt.scatter(X_PCA[690:2759, 0], X_PCA[690:2759, 1], c='green', label= 'Distortion')
plt.scatter(X_PCA[2760:4829, 0], X_PCA[2760:4829, 1], c='yellow', label= 'Modulation')
plt.scatter(X_PCA[4830:6899, 0], X_PCA[4830:6899, 1], c='orange', label= 'Delays')
plt.scatter(X_PCA[6900:8969, 0], X_PCA[6900:8969, 1], c='cyan', label= 'Reverbs')

plt.legend()
plt.title('Latent Space PCA 2D by Fx type')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
variance: 
[0.4851443  0.02558834]
In [ ]:
########VISUALIZACIONES POR EFECTO#############
In [ ]:
###visualización PCA 3D CLEAN

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[0:689])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='gray', label= fx[0])

plt.legend()
plt.title('Latent Space PCA 3D Clean')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###PCA 2D CLean

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[0:689])
print('variance: ')
print(pca.explained_variance_ratio_)

# "transform" the data that you want to reduce to "two components"
plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='gray', label= fx[0])


plt.legend()
plt.title('Latent Space PCA 2D Clean')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\1923095160.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.2880488  0.0437688  0.00464755]
variance: 
[0.2880488  0.04376879]
In [ ]:
###visualización PCA 3D Tube Screamer

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "three components"

X_PCA = pca.fit_transform(Xmu_FFT[690:1379])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='green', label= fx[1])

#ax.scatter3D(X_PCA[690:1379, 0], X_PCA[690:1379, 1],X_PCA[690:1379, 2], c='green', label=fx[1])

plt.legend()
plt.title('Latent Space PCA 3D Tube Screamer')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###PCA 2D TubeScreamer

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[690:1379])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='green', label= fx[1])

plt.legend()
plt.title('Latent Space PCA 2D Tube Screamer')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\4148814300.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.04353125 0.02140255 0.00415609]
variance: 
[0.04353126 0.02140256]
In [ ]:
###visualización PCA 3D Blues Driver

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[1380:2069])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='blue', label= fx[2])

plt.legend()
plt.title('Latent Space PCA 3D Blues Driver')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Blues Driver

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[1380:2069])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='blue', label= fx[2])

plt.legend()
plt.title('Latent Space PCA 2D Blues Driver')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\2443353391.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.06636224 0.01103364 0.00518868]
variance: 
[0.06636224 0.01103364]
In [ ]:
###visualización PCA 3D RAT Distortion

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[2070:2759])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='red', label= fx[3])

plt.legend()
plt.title('Latent Space PCA 3D RAT Distortion')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Rat Distortion

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[2070:2759])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='red', label= fx[3])

plt.legend()
plt.title('Latent Space PCA 2D RAT Distortion')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\3480803598.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.11467139 0.01203825 0.00529942]
variance: 
[0.11467139 0.01203825]
In [ ]:
###visualización PCA 3D Chorus

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[2760:3449])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='yellow', label= fx[4])

plt.legend()
plt.title('Latent Space PCA 3D Chorus CE-3')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Chorus

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[2760:3449])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='yellow', label= fx[4])

plt.legend()
plt.title('Latent Space PCA 2D Chorus CE-3')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\917519763.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.24426587 0.02484723 0.02238893]
variance: 
[0.24426582 0.02484721]
In [ ]:
###visualización PCA 3D Phaser

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[3450:4139])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='black', label= fx[5])

plt.legend()
plt.title('Latent Space PCA 3D Phaser 45')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Phaser

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[3450:4139])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='black', label= fx[5])

plt.legend()
plt.title('Latent Space PCA 2D Phaser 45')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\978538349.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.21188237 0.04289786 0.03927191]
variance: 
[0.21188237 0.04289786]
In [ ]:
###visualización PCA 3D Flanger

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[4140:4829])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='magenta', label= fx[6])

plt.legend()
plt.title('Latent Space PCA 3D Flanger')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Flanger

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[4140:4829])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='magenta', label= fx[6])

plt.legend()
plt.title('Latent Space PCA 2D Flanger')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\4146746576.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.20497236 0.02093905 0.0196279 ]
variance: 
[0.20497239 0.02093894]
In [ ]:
###visualización PCA 3D Tape Echo

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[4830:5519])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='orange', label= fx[7])

plt.legend()
plt.title('Latent Space PCA 3D Tape Echo')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Tape Echo

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[4830:5519])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='orange', label= fx[7])

plt.legend()
plt.title('Latent Space PCA 2D Tape Echo')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\1264904086.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.22699411 0.04471902 0.01341141]
variance: 
[0.22699407 0.04471903]
In [ ]:
###visualización PCA 3D Sweep Echo

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[5520:6209])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='pink', label= fx[8])

plt.legend()
plt.title('Latent Space PCA 3D Sweep Echo')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Sweep Echo

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[5520:6209])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='pink', label= fx[8])

plt.legend()
plt.title('Latent Space PCA 2D Sweep Echo')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\2075732589.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.24630821 0.05434977 0.02794126]
variance: 
[0.2463081  0.05434976]
In [ ]:
###visualización PCA 3D Digital Delay

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[6210:6899])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='brown', label= fx[9])

plt.legend()
plt.title('Latent Space PCA 3D Digital Delay')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Digital Delay

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[6210:6899])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='brown', label= fx[9])

plt.legend()
plt.title('Latent Space PCA 2D Digital Delay')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\1037091683.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.20262809 0.04317728 0.01319938]
variance: 
[0.20262802 0.04317728]
In [ ]:
###visualización PCA 3D Hall Reverb

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[6900:7589])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='cyan', label= fx[10])

plt.legend()
plt.title('Latent Space PCA 3D Hall Reverb')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Hall Reverb

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[6900:7589])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='cyan', label= fx[10])

plt.legend()
plt.title('Latent Space PCA 2D Hall Reverb')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\1972300193.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.25046554 0.03187001 0.01178448]
variance: 
[0.25046554 0.03187   ]
In [ ]:
###visualización PCA 3D Plate Reverb

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[7590:8279])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='lightgreen', label= fx[11])

plt.legend()
plt.title('Latent Space PCA 3D Plate Reverb')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Plate Reverb

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[7590:8279])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='lightgreen', label= fx[11])

plt.legend()
plt.title('Latent Space PCA 2D Plate Reverb')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\2960334856.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.35201666 0.03757045 0.00660731]
variance: 
[0.35201666 0.03757045]
In [ ]:
###visualización PCA 3D Spring Reverb

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[8280:])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='indigo', label= fx[12])

plt.legend()
plt.title('Latent Space PCA 3D Spring Reverb')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Spring Reverb

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[8280:])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='indigo', label= fx[12])

plt.legend()
plt.title('Latent Space PCA 2D Spring Reverb')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\462201660.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.28175882 0.02927685 0.00947048]
variance: 
[0.28175882 0.02927685]
In [ ]:
###visualización PCA 3D Distortions

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[690:2759])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='green', label= fx[1])
ax.scatter3D(X_PCA[690:1379, 0], X_PCA[690:1379, 1],X_PCA[690:1379, 2], c='blue', label= fx[2])
ax.scatter3D(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1],X_PCA[1380:2069, 2], c='red', label= fx[3])

plt.legend()
plt.title('Latent Space PCA 3D Distortions')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Distortions

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[690:2759])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='green', label= fx[1])
plt.scatter(X_PCA[690:1379, 0], X_PCA[690:1379, 1], c='blue', label= fx[2])
plt.scatter(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1], c='red', label= fx[3])

plt.legend()
plt.title('Latent Space PCA 2D Distortions')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\3168628596.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.41137254 0.01385763 0.0028659 ]
variance: 
[0.41137263 0.01385762]
In [ ]:
###visualización PCA 3D Modulations

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[2760:4829])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='yellow', label= fx[4])
ax.scatter3D(X_PCA[690:1379, 0], X_PCA[690:1379, 1],X_PCA[690:1379, 2], c='black', label= fx[5])
ax.scatter3D(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1],X_PCA[1380:2069, 2], c='magenta', label= fx[6])

plt.legend()
plt.title('Latent Space PCA 3D Modulations')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Modulations

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[2760:4829])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='yellow', label= fx[4])
plt.scatter(X_PCA[690:1379, 0], X_PCA[690:1379, 1], c='black', label= fx[5])
plt.scatter(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1], c='magenta', label= fx[6])

plt.legend()
plt.title('Latent Space PCA 2D Modulations')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\400331826.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.238396   0.02670962 0.0227097 ]
variance: 
[0.23839603 0.02670959]
In [ ]:
###visualización PCA 3D Delays

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[4830:6899])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='orange', label= fx[7])
ax.scatter3D(X_PCA[690:1379, 0], X_PCA[690:1379, 1],X_PCA[690:1379, 2], c='pink', label= fx[8])
ax.scatter3D(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1],X_PCA[1380:2069, 2], c='brown', label= fx[9])

plt.legend()
plt.title('Latent Space PCA 3D Delays')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Delays

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[4830:6899])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='orange', label= fx[7])
plt.scatter(X_PCA[690:1379, 0], X_PCA[690:1379, 1], c='pink', label= fx[8])
plt.scatter(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1], c='brown', label= fx[9])

plt.legend()
plt.title('Latent Space PCA 2D Delays')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\3654606844.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.22821906 0.04480846 0.02164726]
variance: 
[0.22821897 0.04480847]
In [ ]:
###visualización PCA 3D Reverbs

fig = plt.figure(1, figsize=(12, 6))
ax = Axes3D(fig)#,elev=-0, azim= 0)
#X_reduced = PCA(n_components=3).fit_transform(X)

# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 3)

# "transform" the data that you want to reduce to "two components"
X_PCA = pca.fit_transform(Xmu_FFT[6900:])
print('variance: ')
print(pca.explained_variance_ratio_)

ax.scatter3D(X_PCA[:689, 0], X_PCA[:689, 1],X_PCA[:689, 2], c='cyan', label= fx[10])
ax.scatter3D(X_PCA[690:1379, 0], X_PCA[690:1379, 1],X_PCA[690:1379, 2], c='lightgreen', label= fx[11])
ax.scatter3D(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1],X_PCA[1380:2069, 2], c='indigo', label= fx[12])

plt.legend()
plt.title('Latent Space PCA 3D Reverbs')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

###visualización PCA 2D Reverbs

fig = plt.figure(1, figsize=(12, 6))
# create the PCA instance with the number of components to be computed 
pca = PCA(n_components= 2)

X_PCA = pca.fit_transform(Xmu_FFT[6900:])
print('variance: ')
print(pca.explained_variance_ratio_)

plt.scatter(X_PCA[:689, 0], X_PCA[:689, 1], c='cyan', label= fx[10])
plt.scatter(X_PCA[690:1379, 0], X_PCA[690:1379, 1], c='lightgreen', label= fx[11])
plt.scatter(X_PCA[1380:2069, 0], X_PCA[1380:2069, 1], c='indigo', label= fx[12])

plt.legend()
plt.title('Latent Space PCA 2D Reverbs')
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()
C:\Users\LENOVO LEGION  Y720\AppData\Local\Temp\ipykernel_15036\2084875719.py:4: MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.
  ax = Axes3D(fig)#,elev=-0, azim= 0)
variance: 
[0.30599877 0.03257775 0.00854183]
variance: 
[0.30599877 0.03257775]